#ifndef AVALON_WRITER_HPP
#define AVALON_WRITER_HPP
#include <boost/noncopyable.hpp>
#include "Avalon/IO/IO.hpp"
#include "Avalon/Threading/Async.hpp"

namespace Avalon {
namespace IO {

  /*! \class Writer
   *  \brief Interface for writing data to a resource.
   */
  class Writer : private boost::noncopyable {
    public:

      virtual ~Writer();

      //! Writes data to the resource.
      /*!
        \param data The data to write.
        \param size The size of the data.
        \param result The result of the write.
      */
      virtual void Write(const void* data, int size,
        Out<Threading::Async<void> > result) = 0;

      //! Writes data to the resource.
      /*!
        \param data The data to write.
        \param result The result of the write.
      */
      virtual void Write(const Buffer& data,
        Out<Threading::Async<void> > result) = 0;
  };
}
}

#endif // AVALON_WRITER_HPP
